<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
  <img alt="" class="img" id="loveButton" src="./images/图片1.jpg"></img>
  <img alt="" class="img" id="displayImage">

    <script>
        document.getElementById('loveButton').addEventListener('click', function() {
            if (confirm("你喜欢我吗")) {
                document.getElementById('displayImage').src = "./images/图片2.jpg"; 
                document.getElementById('loveButton').style.display = "none";

            } else {
                document.getElementById('displayImage').src = "./images/图片3.jpg";
                document.getElementById('loveButton').style.display = "none";

            }
        });
    </script>
</body>
</html>
